/*  

Cafechess Library: Cover basic chess programming needs, like GUI, Engine integration, 
FEN and PGN parsing.

                 \\|//
                 (o o)
--------------ooO-(_)-Ooo----------------------------------
Copyright (C) 2009  By Gregory A. Prentice Snoqualmie, WA
                    www.cafechess.org
                    cafechess@comcast.net
                      Oooo
--------------oooO----(  )---------------------------------
              (  )    (_/
               \_)

Microsoft Public License (Ms-PL)
               
Revisions:

Author        Date    Description:

*/
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

namespace Cafechess.Imaging.Draw
{
  /// <summary>
  /// Summary description for DrawLine.
  /// </summary>
  public class DrawArrow : DrawOnMouseEvents
  {
    public DrawArrow(System.Windows.Forms.Control aControl) : base(aControl)
    {
      coPen = new Pen(Color.Blue, 1);
      coPen.EndCap = LineCap.Custom;
      coPen.CustomEndCap = new AdjustableArrowCap(3, 3, true);
    }
    public DrawArrow(System.Windows.Forms.Control aControl, Color color, int width) : base(aControl)
    {
      coPen = new Pen(color, width);
      coPen.EndCap = LineCap.Custom;
      coPen.CustomEndCap = new AdjustableArrowCap(3, 3, true);
    }

    override public void EraseMoving(Graphics g)
    {
      ControlPaint.DrawReversibleLine(StartScreenPoint,EndScreenPoint, Color.Black);

    }
    override public void DrawMoving(Graphics g)
    {
      ControlPaint.DrawReversibleLine(StartScreenPoint,EndScreenPoint, Color.Black);
    }
    override public void DrawFinished(Graphics g)
    {
      g.DrawLine(coPen, StartPoint, EndPoint);
    }
    override public bool HitTest(Point point)
    {
      return true;
    }
  }
}
